<template>
  <div style="height: 765px">

    <!--主体内容-->
    <el-row :gutter="0" style="background:white;border-bottom: 1px solid #CCCCCC;margin: -20px;text-align: left;height: 40px;line-height: 40px">
      <el-col :span="24" :offset="0" style="">
        <el-button type="text" @click="goback">< 借款记录 贷款证明</el-button>
      </el-col>
    </el-row>

    <el-row :gutter="0" style="margin-top: 40px;margin-bottom: 20px">
      <el-col :span="24" :offset="0" style="">
        <el-button-group>
          <el-button type="primary" style="width: 214px" @click="fun1">借款记录</el-button>
          <el-button type="" style="width: 214px" @click="fun2">还款记录</el-button>
        </el-button-group>
      </el-col>
    </el-row>
    <el-row :gutter="0" style="border-bottom: 1px solid #CCCCCC;padding:10px;background-color:white" v-for="(o, index) in person" :key="o.id" :offset="index  > 0 ? 3 : 0" >
      <el-col :span="15"  style="padding: 5px;">
        <div>金钱：{{o.loanapplication.loanAmount}}</div>
        <div>时间：{{o.loanrepayment.repaymentTime}}</div>
      </el-col>

      <el-col :span="4" :offset="2" style="">
        <el-link type="_blank" @click="fun1" style="">
          <!--已还款-->{{o.loanrepayment.paymentStatus}}
        </el-link>
      </el-col>
    </el-row>


<!--
    <el-row :gutter="0" style="border-bottom: 1px solid green;padding:10px;background-color:white">
      <el-col :span="7" :offset="0" style="">
        <div>500.00</div>
        <div>2020年11月02日</div>
      </el-col>

      <el-col :span="6" :offset="11" style="">
        <el-link type="_blank" @click="fun1" style="">
          使用中 >
        </el-link>
      </el-col>
    </el-row>-->

  </div>
</template>
<!--

<script>
    export default {
      name: "borrowRecord",
      data:{

      },
      methods: {
        findPartMessage:function(){

    },

        goback:function () {
          this.$router.push("/personal")
        },
        fun1:function () {
          this.$router.push("/borrowRecord")
        },
        fun2:function () {
          this.$router.push("/repaymentRecord")
        }
      },
      mounted(){
        /*传名字和状态查*/
        this.findPartMessage(this.$route.params.name,paymentStatus);
      }
    }
</script>
-->


<script>
  import axios from  'axios'
  export default {
    name: "borrowRecord",
    data(){
      return{
        borrowerId:1,
        paymentStatus:"待还款",
        person:[],
        form:{},
        loanAmount:'',
        repaymentTime:'',
      };

    },
    methods: {
      findPartMessagePaymentStatus:function(){
        // alert("shiyan1");
        // alert("id"+borrowerId+",asdas"+paymentStatus);
        axios.post("http://localhost:9999/credit-personal/findPartMessagePaymentStatus", {borrowerId:this.borrowerId,paymentStatus:this.paymentStatus}).then(res=>{
          // alert("shiyan");
          this.person=res.data;
          console.log(res.data);//控制台数据
        })

      },

      goback:function () {
        this.$router.push("/personal")
      },
      fun1:function () {
        this.$router.push("/borrowRecord")
      },
      fun2:function () {
        this.$router.push("/repaymentRecord")
      }
    },
    mounted(){
      this.findPartMessagePaymentStatus(1,"待还款");//name,paymentStatus
    /*传名字和状态查*/
      //   this.findPartMessage(this.$route.params.name,paymentStatus);
    }
  }
</script>

<style scoped>

</style>
